﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Core.Domain;
using Library.Extensions.Expressions;

namespace Core.Queries
{
    public class DictionaryItemQuery : Query<DictionaryItem>
    {
        public int? DictionaryID { get; set; }

        public override Expression<Func<DictionaryItem, bool>> ToExpression()
        {
            Expression<Func<DictionaryItem, bool>> predicate = x => true;            
            if (DictionaryID.HasValue)
                predicate = predicate.And(x => x.DictionaryID == DictionaryID);

            return predicate;
        }        
    }   
}